<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page isELIgnored="false" %>
<html>
<head>
    <title>Title</title>
    <%@include file="/common/header.jsp"%>
    <link rel="stylesheet" href="/css/index.css" type="text/css">
</head>
<body>
<div id="root">
    <div class="layout">
        <Layout>
            <Header>
                <i-Menu mode="horizontal" theme="dark" active-name="1">
                    <div class="layout-logo">
                    <Avatar src="https://dev-file.iviewui.com/userinfoPDvn9gKWYihR24SpgC319vXY8qniCqj4/avatar"></Avatar>
                    </div>
                    <div class="layout-nav">
                        <h3 style="color:white">匡威后台系统</h3>
                        <i-button type="primary" size="small" style="position:relative;top:-30px;left:990px;" @click="logout()">退出</i-button>
                    </div>
                </i-Menu>
            </Header>
            <Layout>
                <%--<sider collapsible collapsible-width="1%"  v-model="isCollapsed" :style="{background: '#fff'}" :class="menuitemClasses">--%>
                    <%--<i-Menu active-name="1-2" theme="light" width="auto" :open-names="['1']">--%>
                        <%--<submenu v-for="m1 in menus" :name="m1.id">--%>
                            <%--<template slot="title">--%>
                                <%--<icon :type="m1.icon"></icon>--%>
                                <%--{{m1.name}}--%>
                            <%--</template>--%>
                            <%--<menu-item v-for="m2 in m1.children" :name="m2.id">--%>
                                <%--<a :href="m2.url" target="main">{{m2.name}}</a>--%>
                            <%--</menu-item>--%>
                        <%--</submenu>--%>

                    <%--</i-Menu>--%>
                <%--</sider>--%>
                    <Sider hide-trigger :style="{background: '#fff'}">
                        <i-Menu active-name="1-2" theme="light" width="auto" :open-names="['1']">
                            <c:forEach items="${menulist}" var="po1" varStatus="status01">
                                <Submenu name="${status01.count}">
                                    <template slot="title">
                                        <Icon type="ios-navigate"></Icon>
                                       ${po1.name}
                                    </template>
                                    <c:forEach items="${po1.children}" var="p02" varStatus="status02">
                                        <Menu-Item name="${status01.count-status02.count}">
                                        <a href="${p02.url}" target="main">${p02.name}</a>
                                        </Menu-Item>
                                    </c:forEach>
                                </Submenu>
                            </c:forEach>
                        </i-Menu>
                    </Sider>
                    <Layout :style="{padding: '0 24px 24px'}">
                        <i-Content :style="{minHeight: '1000px', background: '#fff'}">
                            <iframe name="main" width="100%" height="100%" frameborder="0"></iframe>
                        </i-Content>
                    </Layout>
            </Layout>
        </Layout>
    </div>
</div>
<script>
    <%--new Vue({--%>
        <%--el:"#root",--%>
        <%--data:{--%>
            <%--menus:[],--%>
            <%--isCollapsed: false--%>
        <%--},--%>
        <%--computed: {--%>
            <%--menuitemClasses: function () {--%>
                <%--return [--%>
                    <%--'menu-item',--%>
                    <%--this.isCollapsed ? 'collapsed-menu' : ''--%>
                <%--]--%>
            <%--}--%>
        <%--},--%>
        <%--methods:{--%>
            <%--logout(){--%>
                <%--location.href = "${pageContext.request.contextPath}/logout";--%>
            <%--},--%>
            <%--createMenu(){--%>
                <%--axios.get("${pageContext.request.contextPath}/createMenu")--%>
                    <%--.then(({data})=>{--%>
                        <%--this.menus=data.result;--%>
                    <%--});--%>
            <%--}--%>
        <%--},--%>
        <%--mounted(){--%>
            <%--this.createMenu();--%>
        <%--}--%>
    <%--})--%>
    new Vue({
        el:"#root",
        methods:{
            logout(){
                location.href = "${pageContext.request.contextPath}/logout";
            }
        }
    })
</script>
</body>
</html>
